// 引入
import requests from './request'
const baseUrl = 'http://localhost:9999/chuyangc'
//api列表

//日志相关api
//获取登入状态列表
export const listLogins = (id) => {
  return requests({
    url: baseUrl + '/logrec/pageinslist/' + id,
    method: 'GET'
  })
};

//获取登出状态列表
export const listLogouts = (id) => {
  return requests({
    url: baseUrl + '/logrec/pageoutslist/' + id,
    method: 'GET'
  })
};

//添加日志记录
export const addLog = (logrec) => {
  return requests({
    data: logrec,
    url: baseUrl + '/logrec/add',
    method: 'POST'
  })
};

//删除日志记录
export const delLog = (id) => {
  return requests({
    data: id,
    url: baseUrl + '/logrec/del/' + id,
    method: 'DELETE'
  })
};

//对日志记录的logtype值进行更新操作
export const setInvert = (logrec) => {
  return requests({
    data: logrec,
    url: baseUrl + '/logrec/setinvert',
    method: 'POST'
  })
}

//不同登录状态下的日志记录数统计
export const getLogCount = () => {
  return requests({
    url: baseUrl + '/logrec/logchart',
    method: 'GET'
  })
}

//获取所有日志记录的数量
export const getLogTotal = () => {
  return requests({
    url: baseUrl + '/logrec/total',
    method: 'GET'
  })
}

//获取所有日志记录
export const getLoglist = () => {
  return requests({
    url: baseUrl + '/logrec/list',
    method: 'GET'
  })
}

//物流相关api
//获取物流状态为送货中的列表
export const listTransporttrans = (id) => {
  return requests({
    url: baseUrl + '/transport/pagetranslist/' + id,
    method: 'GET'
  })
};

//获取物流状态为已签收的列表
export const listTransportrecie = (id) => {
  return requests({
    url: baseUrl + '/transport/pagerecielist/' + id,
    method: 'GET'
  })
};

  //获取物流状态为发货中的列表
export const listTransportsend = (id) => {
  return requests({
    url: baseUrl + '/transport/pagesendlist/' + id,
    method: 'GET'
  })
};

//添加物流记录
export const addTrans = (Trans) => {
  return requests({
    data: Trans,
    url: baseUrl + '/transport/add',
    method: 'POST'
  })
};

//删除物流记录
export const delTrans = (id) => {
  return requests({
    data: id,
    url: baseUrl + '/transport/del/' + id,
    method: 'DELETE'
  })
};

//不同物流状态下的记录数统计
export const getTransCount = () => {
  return requests({
    url: baseUrl + '/transport/transchart',
    method: 'GET'
  })
}

//获取所有物流记录的数量
export const getTransTotal = () => {
  return requests({
    url: baseUrl + '/transport/total',
    method: 'GET'
  })
}

//获取所有物流记录
export const getTranslist = () => {
  return requests({
    url: baseUrl + '/transport/list',
    method: 'GET'
  })
}

//获取IP
export const getLocalIP = () => {
  return requests({
    url: 'https://gamematrix.qq.com/sdk/v2/get_gateway',
    method: 'GET'
  })
};

//获取目标IP地址
export const getLocaladdress = () => {
  return requests({
    url: 'https://ipapi.co/json/',
    method: 'GET'
  })
};